<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box {
            width: 200px;
            height: 200px;
            background-color: pink;
            /* 谁做动画就给谁 */
            animation: dong 5s steps(40) infinite;
        }

        @keyframes dong {
            0% {
                width: 300px;
                background-color: rgb(135, 207, 26);

            }

            50% {
                width: 400px;
                background-color: rgb(135, 187, 205);

            }

            100% {
                width: 500px;
                background-color: rgb(215, 177, 184);
                
            }
            
        }
    </style>
</head>

<body>

    <div class="box"></div>
</body>

</html>